<include file="__PUBLIC__/head.html"/>
<css file="__PUBLIC__/css/arc.css"/>
<css file="__ROOT__/uploadify/uploadify.css"/>
<script type="text/javascript" src="__ROOT__/uploadify/jquery.uploadify.min.js"></script>

<script type="text/javascript" src="__PUBLIC__/js/jqueryui.js"></script>
<script>
    $(function(){
        $("#pic_thumb").uploadify({
            height        : 30,
            buttonImage   : '__ROOT__/uploadify/button.jpg',
            swf           : '__ROOT__/uploadify/uploadify.swf',
            uploader      : '__CONTROL__/upload/{$sonid}/{$cokval}',
            width         : 120,
            onUploadSuccess:function(file, data, response) {
                eval("data="+data);
                if(data.msg=='error'){
                    alert("上传失败,文件过大");return;
                }
                var str='';
                str='<div>\
            <input type="hidden" name="rec_img" value="'+data.file+'"/><input type="hidden" name="pic_thumb" value="'+data.thumb+'"/>\
            <img rec_img="'+data.file+'" thumb="'+data.thumb+'" src="__ROOT__/'+data.thumb+'" width="120" heigth="80"/></div>'
                $.post("__CONTROL__/delpic",{path:$(".pic img").attr("thumb"),rec:$(".pic img").attr("rec_img")})
                $(".pic").html("").append(str);
            }
        });
        
        $( "#tab" ).tabs();
    })
</script>

</head>
<body>
    <form action="__CONTROL__/edit" method="post" enctype="multipart/form-data">
        <div id="tab" class="content add_show">
            <ul>
                <li><a href="#tabs-1">基本设置</a></li>
                <li><a href="#tabs-2">SEO设置</a></li>
            </ul>
            <div id="tabs-1">
                <table class="table1">
                    <input type="hidden" value="{$arc.arc_id}" name="arc_id"/>
                    <tr>
                        <th>选择栏目</th>
                        <td>
                            <select name="cat_pid">
                                <list from="$cat" name="$v">
                                <if value="$v.cat_id==$arc.cat_id">
                                    <option value="{$v.cat_id}" selected="selected">{$v.html}{$v.cat_name}</option>
                                    <else>
                                        <option value="{$v.cat_id}">{$v.html}{$v.cat_name}</option>
                                </if>
                                </list>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <th>标题</th>
                        <td>
                            <input class="entry" type="text" name="title" value="{$arc.title}"/>
                        </td>
                    </tr>
                    <tr>
                        <th>属性</th>
                        <td>
                    <if value="$arc.is_ding">
                        <input type="checkbox" name="is_ding" checked="checked" value="1"/> 置顶
                        <else>
                            <input type="checkbox" name="is_ding" value="1"/> 置顶
                    </if>

                    <if value="$arc.is_tui">
                        <input type="checkbox" name="is_tui" checked="checked" value="1"/> 推荐
                        <else>
                            <input type="checkbox" name="is_tui" value="1"/> 推荐
                    </if>

                    </td>
                    </tr>
                    <tr>
                        <th>缩略图</th>
                        <td>
                            <input type="file" id="pic_thumb" name="pic_thumb"/>
                            <div class="pic">
                                <img width="120" heigth="80" src="__ROOT__/{$arc.pic_thumb}" thumb="{$arc.pic_thumb}" rec_img="{$arc.rec_img}">
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th>点击次数</th>
                        <td>
                            <input type="text" name="click" value="{$arc.click}"/>
                        </td>
                    </tr>
                    <tr>
                        <th>正文内容</th>
                        <td>
                    <editor type="1" name="content" content="{$arc.content}"/>
                    </td>
                    </tr>
                </table>
            </div>

            <div id="tabs-2">
                <table class="table1">
                    <tr>
                        <th>关键字</th>
                        <td>
                            <input class="entry" type="text" name="keywords" value="{$arc.keywords}"/><span style="color: #d00;">多个关键词用 | 或 ，建议填三到五个</span>
                        </td>
                    </tr>
                    <tr>
                        <th>描述</th>
                        <td>
                            <textarea  class="entry" cols="50" row="8" name="description">{$arc.description}</textarea><span style="color: #d00;">建议控制在80个字符以内</span>
                        </td>
                    </tr>
                </table>
            </div>
            <div>
                <input type="submit" value="确认修改"/>
                <a href="__APP__/arc">放弃返回</a>
            </div>
        </div>
    </form>
</body>
</html>